﻿<script src="js/formfunc.js"></script>
<script src="js/ajaxfileupload.js"></script>
<?php if (!isset($_sentText)) { 
	if ($title != 'Direct Messages') {
	echo "<h2>随便说说</h2>" ;
	} ?> 
<span id="tip"><b>140</b></span>
<?php } ?>

<form enctype="multipart/form-data" action="ajax/uploadPhoto.php" method="post" id="photoArea">
</form>

<form id="filterArea">
</form>

<form id="symArea">
<div id="symbols"></div>
<a class="close" title="Close" onclick="$('#symArea').slideToggle(300)" href="#"></a>
</form>

<form id="transArea"></form>

<form action="index.php" method="post">
<a id="transRecover">Restore</a>
<textarea name="status" id="textbox" onkeyup="findcon();" ><?php if (isset($_sentText)) echo $_sentText ?></textarea>
<input type="hidden" id="in_reply_to" name="in_reply_to" value="<?php echo isset($_sentInReplyTo) ? $_sentInReplyTo : 0 ?>" />
<?php
	$t = getTwitter();
	$current_user = $t->veverify();
	if ($current_user === false) {
		header('location: error.php');exit();
	} 
	$empty = count($current_user) == 0? true: false;
	if ($empty) {
		echo "<div id=\"currently\">
			<span id=\"full_status\" title=\"Click to view the full tweet\"><strong >Latest:</strong></span>
			<span id=\"latest_status\">
			<span id=\"latest_text\">
			<span class=\"status-text\">What's shaking?</span>
			<span class=\"full-text\" style=\"display:none\">What's shaking?</span>
			<span class=\"entry-meta\" id=\"latest_meta\"></span>
			<span class=\"entry-meta\" id=\"full_meta\"></span>
			</span>
			</span>
			</div>";
	} else {
			$status = $current_user->status;
			$date = formatDate($status->created_at);
			$text = formatText($status->text);
			$output = "
				<div id=\"currently\">
				<span id=\"full_status\"><strong>最后:</strong></span>
				<span id=\"latest_status\">
				<span id=\"latest_text\">
				<span class=\"status-text\">" . $text . "</span>
				<span class=\"full-text\" style=\"display:none\">" . $text . "</span>
				<span class=\"entry-meta\" id=\"latest_meta\"><a href=\"status.php?id=$status->id_str\" target=\"_blank\">" . $date . "</a></span>
				<span class=\"entry-meta\" id=\"full_meta\" style=\"display:none\"><a href=\"status.php?id=$status->id_str\" target=\"_blank\">" . $date . "</a></span>
				</span>
				</span>
				</div>
				";
		echo $output;
	}
?>
<div id="tweeting_controls">
	<a class="a-btn a-btn-m btn-disabled" id="tweeting_button" tabindex="2" href="#" title="Ctrl+Enter also works!"><span>
		<?php if($title == '短信息(DM)') {
			echo '发送';
			} else {
				echo 'Tweet';
			} ?>
		</span></a>
	</div>
	
	<div id="func_set">
		<a class="func_btn" href="javascript:shortUrlDisplay();" title="缩短网址" style="background-position:-238px -113px">缩短网址</a>
		<a id="transBtn" title="翻译设置" class="func_btn" style="background-position:-110px -80px;">翻译</a>
		<a title="上传图片" id="photoBtn" class="func_btn" style="background-position: -207px -128px;">图片</a>
		<a id="filterBtn" title="时间线过滤器" class="func_btn" style="background-position:-174px -112px;">过滤器</a>
		<a id="symbolBtn" title="颜文字" class="func_btn" style="background-position: -206px -113px;">颜文字</a>
		<a id="autoBtn" title="时间线自动刷新控制" class="func_btn pause">自动/暂停</a>
		<a id="clearBtn" style="background-position: 3px -176px;" class="func_btn" title="清理页面">清理页面</a>
		<a id="refreshBtn" title="刷新时间线" class="func_btn" style="background-position: -62px -80px;">刷新</a>
	</div>
	</form>
	<div id='fixname'></div>
	<div class="clear"></div>